public class InputTest {
    static public void main(String [] args) {
        int in, color = 30;
        char ch;

        Kyo.init();
        Kyo.p("w = %d, h = %d\n", Kyo.w(), Kyo.h());

        while (true) {
            in = Kyo.key();
            if (in == 27)
                break;
            if (in == 'w')
                Vt.move(Vt.UP, 1);
            else if (in == 's')
                Vt.move(Vt.DOWN, 1);
            else if (in == 'a')
                Vt.move(Vt.LEFT, 1);
            else if (in == 'd')
                Vt.move(Vt.RIGHT, 1);
            else if (in == 'c')
                Vt.cmd(Vt.SCREEN);
            else if (in == ' ')
                color = (int)(Math.random() * 7 + 30);
            else {
                ch = (char)in;
                Vt.out("".valueOf(ch), color);
            }
            Kyo.get();
            Kyo.p("w = %d, h = %d\n", Kyo.w(), Kyo.h());
        }
        Kyo.exit();
    }
}
